package lg.minecraft.plugin.worldprotect.command;

import lg.minecraft.plugin.library.command.CommandContext;
import lg.minecraft.plugin.library.command.CommandType;
import lg.minecraft.plugin.library.command.SubCommand;
import lg.minecraft.plugin.worldprotect.LGWorldProtect;

/**
 * @author langle__
 * @version 1.0
 */
public class ReloadCommand extends SubCommand {

    public ReloadCommand() {
        super("reload", "r");
    }

    @Override
    public String getDescription() {
        return "配置重载";
    }

    @Override
    public String getPermission() {
        return "LGWorldProtect.command.reload";
    }

    @Override
    public CommandType getCommandType() {
        return CommandType.PLAYER;
    }

    @Override
    public void onCommand(CommandContext context) {
        LGWorldProtect.getLanguage().load();
        LGWorldProtect.getMainConfig().load();
        LGWorldProtect.getWorlds().load();
        context.getSender().sendMessage("[§6WorldProtect§f] 配置重载成功！");
    }

}
